<?php

namespace App\Console;

use App\Supports\Delivery\AutoReceiver;
use Illuminate\Console\Scheduling\Schedule;
use App\Services\Statistics\HardCountRefresh;
use App\Services\GoldStormTimer\GoldStormTimer;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    protected $commands = [
        //
    ];

    protected function schedule(Schedule $schedule)
    {
	    $schedule->call(new HardCountRefresh())->everyFiveMinutes()->name('hard_count')->onOneServer();
	    $schedule->call(new GoldStormTimer())->everyMinute()->name('storm_timer')->onOneServer();

    	$schedule->command('cc:init')->daily()->onOneServer();
    	$schedule->command('cc:withdraw-to-alipay')->dailyAt('10:00')->onOneServer();

    	$schedule->call(new AutoReceiver())->dailyAt('7:00')->name('auto_receiver')->onOneServer();
    }

    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
